﻿using IceCS.DesignPattern.Core.AbstractFactoryPattern.KFC.Foods;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IceCS.DesignPattern.Core.AbstractFactoryPattern.KFC
{
    public class Order
    {
        public Order()
        {
            this.Foods = new List<FoodBase>();
        }
        public decimal Total { get; set; }
        public List<FoodBase> Foods { get; set; }
        public string GetResult()
        {
            string res = string.Empty;
            foreach (var f in Foods)
            {
                res += f.GetFoodInfo() + "\r\n";
            }
            return res;
        }

        public decimal GetTotal()
        {
            decimal res = 0M;
            foreach (var f in Foods)
            {
                res += f.GetPrice();
            }
            return res;
        }
    }
}
